<!-- 4481用 -->
<template>
  <div class="monitoring">
    <el-form ref="form" :model="form" label-width="75px">
      <el-form-item label="车牌号" style="width: 250px">
        <el-input v-model="form.name" placeholder="请输入车牌"></el-input>
      </el-form-item>
      <el-form-item label="车辆类型"  style="width: 200px; margin-left: 20px; ">
        <el-select v-model="form.carTypeValue" placeholder="请选择车辆类型">
          <el-option
            v-for="(item, index) in selectCarType"
            :value="item.label"
            :label="item.value"
            :key="index"
          ></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="分组" style="width: 200px">
        <!-- <el-cascader v-model="form.groupingValue" :options="groupingList" style="line-height: 26px;"></el-cascader> -->
        <el-select
          v-model="form.groupingValue"
          :options="groupingList"
          placeholder="请选择分组"
        >
          <el-option
            v-for="(item, index) in groupingList"
            :value="item.CLIENT_NO"
            :label="item.CLIENT_NAME"
            :key="index"
          ></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="在线状态" style="width: 150px">
        <!-- <el-cascader v-model="form.groupingValue" :options="groupingList" style="line-height: 26px;"></el-cascader> -->
        <el-select
          v-model="form.statusValue"
          :options="statusOptions"
          placeholder="请选择在线状态"
        >
          <el-option
            v-for="(item, index) in statusOptions"
            :value="item.value"
            :label="item.label"
            :key="index"
          ></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="作业状态" style="width: 160px">
        <el-select
          v-model="form.lockValue"
          :options="lockOptions"
          placeholder="请选择作业状态"
        >
          <el-option
            v-for="(item, index) in lockOptions"
            :value="item.value"
            :label="item.label"
            :key="index"
          ></el-option>
        </el-select>
      </el-form-item>
      <span style="margin-left: 15px;font-size: small;">车辆数量：{{this.carNum}}辆</span>
      <!-- <el-form-item label="排序"> -->
      <!-- <el-radio-group
        v-model="radio"
        size="mini"
        fill="#007ACC"
        text-color="#fff"
        style="padding-left:12px;padding-right:8px;"
        @change="getInfoList"
      >
        <el-radio-button label="定位时间"></el-radio-button>
        <el-radio-button label="称重时间"></el-radio-button>
      </el-radio-group>-->
      <!-- </el-form-item> -->
      <!-- <div style="float: right;padding-right:30px;">
        <div class="people_number">
          在线:
          <span>{{statusNums.onlines}}</span>辆
        </div>
        <div class="people_number">
          全部:
          <span>{{statusNums.alls}}</span>辆
        </div>
      </div>-->

      <el-button
        size="mini"
        type="primary"
        @click="screenData"
        style="margin-left: 15px"
        >查 询</el-button
      >
      <!-- <el-form-item label="尾迹" style="width: 110px; margin-right: 10px">
        <el-select v-model="wakeValue" placeholder="尾迹">
          <el-option value="显示"></el-option>
          <el-option value="隐藏"></el-option>
        </el-select>
      </el-form-item>-->
      <!-- <div class="buttons"> -->
      <!-- <el-button
          class="iconfont icon-kaishi iconone"
          type="success"
          style="background-color:#347F10; color: #fff;"
          @click="startTracking"
          :disabled="disabled1"
        >开始跟踪</el-button>
        <el-button
          class="iconfont icon-tingzhi iconone"
          type="danger"
          style="background-color:#B36969; color: #fff; border: 0 none;"
          @click="cancelTracking"
          :disabled="disabled2"
      >取消跟踪</el-button>-->
      <!-- <el-button
        class="iconfont icon-tongji iconone"
        type="primary"
        size="mini"
        style="background:#468AD0"
        @click="onlineStatistics"
      >实时在线统计</el-button>-->
      <!-- <el-button
        class="iconfont icon-daochu iconone"
        size="mini"
        style="background-color: green; color: #fff; border: 0 none;"
        @click="exportExcel"
      >导出基础信息表</el-button>-->
      <el-button
        class="iconfont icon-daochu iconone"
        size="mini"
        style="background-color: green; color: #fff; border: 0 none"
        @click="exportExcel"
        >导出实时信息表</el-button
      >
      <!-- 自动刷新 -->
      <!-- <div class="switch iconone">
        <span>自动刷新</span>
        <el-switch
          v-model="switch_value"
          active-color="#13ce66"
          inactive-color="#ccc"
          @change="selectChange"
        ></el-switch>
      </div>-->
    </el-form>
    <!-- 人员信息列表 -->
    <div class="table_list">
      <el-table
        :data="screeningData"
        :default-sort="{ prop: 'GPSTIME', order: 'descending' }"
        height="100%"
        style="width: 100%"
        size="mini"
        border
        fit
        highlight-current-row
        @row-contextmenu="rowHandle"
        @row-click="clickRow"
        @row-dblclick="dblClickRow"
        @cell-mouse-enter="cellMouseEnter"
      >
        <el-table-column prop="VID" label="编号" width="80"></el-table-column>
        <el-table-column
          prop="LICENSEPLATE"
          label="车辆名称"
          width="110"
        ></el-table-column>
        <el-table-column
          prop="CARTYPE"
          label="车辆类型"
          width="100"
        ></el-table-column>
        <el-table-column
          prop="STATUSstr"
          label="在线状态"
          width="100"
        ></el-table-column>
        <el-table-column
          prop="GPSTIME"
          label="最终定位时间"
          sortable
          width="170"
        ></el-table-column>
        <el-table-column
          prop="CLIENTNAME"
          label="分组"
          sortable
          width="100"
        ></el-table-column>
        <el-table-column
          prop="LOCATION"
          label="位置"
          width="200"
        ></el-table-column>
        <el-table-column
          prop="LOCK"
          label="作业状态"
          width="100"
        ></el-table-column>
        <el-table-column
          prop="OIL"
          label="剩余油量"
          width="100"
        ></el-table-column>
        <el-table-column
          prop="IsSetupOil"
          label="安装油耗"
          width="100"
        ></el-table-column>
        <el-table-column
          prop="WATER"
          label="剩余水量"
          width="100"
        ></el-table-column>
        <el-table-column
          prop="IsSetupWater"
          label="安装水量"
          width="100"
        ></el-table-column>
        <el-table-column
          prop="VIDEO"
          label="安装视频"
          width="100"
        ></el-table-column>
        <el-table-column
          prop="LOCKSTATUS"
          label="安装开关量"
          width="100"
        ></el-table-column>
        <el-table-column prop="SPEED" label="速度" width="80"></el-table-column>
        <el-table-column
          prop="DIRECTION"
          label="方向"
          width="80"
        ></el-table-column>

        <el-table-column prop="LNG" label="经度" width="100"></el-table-column>
        <el-table-column prop="LAT" label="纬度" width="90"></el-table-column>
      </el-table>
    </div>
    <!-- 右键人员列表菜单 -->
    <div
      class="row_box"
      v-if="MouseEvent.isShow"
      :style="`left: ${MouseEvent.left}px; top: ${MouseEvent.top}px;`"
    >
      <!-- <span @click="exportRowExcel">导出Excel</span> -->
      <!-- <span @click="groupArea(teamNumber)">负责区域</span> -->
      <!-- <span @click="clearArea(teamNumber)">清扫队负责区域</span> -->
      <!-- <span>负责区域</span> -->
      <!-- <span @click="cleanArea">清除区域</span> -->
      <span @click="trajectory">轨迹回放</span>
      <span @click="showCCTV">视频监控</span>
      <span @click="showYHLine">油耗曲线</span>
      <span @click="showWaterLine">水量曲线</span>
    </div>
  </div>
</template>

<script>
import eventBus from '@/eventBus.js'

import export2Excel from '@/utils/exportExcel/index.js'
// 转换地图坐标
// import { getLatLng } from '@/assets/js/pointtransfertools.js'

// import { BMap } from 'vue-baidu-map'
// import BaiduMap from 'vue-baidu-map/components/map/Map.vue'

export default {
  data () {
    return {
      timeID: null,
      account: '',
      // 筛选条件
      form: {
        name: '',
        groupingValue: '',
        statusValue: 0,
        lockValue: '',
        carTypeValue: '全部'
      },
      // 垃圾桶点位数据
      boxData: [],
      // 原始数据
      originalData: [],
      // 类型列表
      typeOptions: ['全部', '巡查员', '指导员'],
      // 状态列表
      statusOptions: [
        { value: '全部', label: '全部' },
        { value: 0, label: '在线' },
        { value: 6, label: '离线' }
      ],
      // 作业列表
      lockOptions: [
        { value: '', label: '全部' },
        { value: '作业中', label: '作业中' },
      ],
      // tableData: [],
      statusNums: {
        alls: 0,
        onlines: 0,
        outlines: 0
      },
      // person_data: [],
      switch_value: true,
      time_value: '',
      time_Interval: [{
        value: 10000,
        label: '10秒'
      }, {
        value: 30000,
        label: '30秒'
      }, {
        value: 60000,
        label: '1分钟'
      }],
      groupingList: [],
      selectCarType: [{
        value: '全部',
        label: '全部'
      }, {
        value: '机扫车',
        label: '机扫车'
      }, {
        value: '小型机扫车',
        label: '小型机扫车'
      }, {
        value: '吸尘车',
        label: '吸尘车'
      }, {
        value: '洒水车',
        label: '洒水车'
      }, {
        value: '高压清洗车',
        label: '高压清洗车'
      }, {
        value: '洗路车',
        label: '洗路车'
      }, {
        value: '除雪车',
        label: '除雪车'
      }],
      wakeValue: '',
      // 筛选数据
      screeningData: [],
      //查询出来的车辆数
      carNum:0,
      // 是否显示实时在线统计对话框
      Visible: false,
      statisticalData: [],
      title: '',
      MouseEvent: {
        top: 0,
        left: 0,
        isShow: false
      },
      // teamNumber: '',
      // 右键表格
      row: null,
      clickRowData: null,
      disabled1: false,
      disabled2: true,
      trackingValue: false,
      localtion: {},
      radio: '定位时间'
    }
  },
  mounted () {
    this.getInfoList()
    this.selectChange()
    

    this.getCLCPolygon()
    this.getGroupingList()

    this.getPlaceWaterInfo()
  },
  methods: {
    dropdown () {
      var fold_btns = document.querySelector('.fold_btns')
      var fold_btn = document.querySelector('.fold_btn')
      var fold_brn = document.querySelector('.fold_brn')
      fold_btn.style.display = 'none';
      fold_brn.style.display = 'inline-block';
      fold_btns.style.display = 'block';
    },
    updown () {
      var fold_btns = document.querySelector('.fold_btns')
      var fold_btn = document.querySelector('.fold_btn')
      var fold_brn = document.querySelector('.fold_brn')
      fold_btn.style.display = 'inline-block';
      fold_brn.style.display = 'none';
      fold_btns.style.display = 'none';
    },
    // 获得分组列表
    async getGroupingList () {
      var url = 'Vehicle/GetGroupList?ClientNo=' + localStorage.getItem('CLIENT_NO') // zxdata
      let { data } = await this.$Http.get(url)
      this.groupingList = data
    },
    // 获取人员信息列表
    async getInfoList () {
      this.realtimeOnlineStatistics()
      var url = 'Vehicle/GetCarListCurrentVehicle?CLIENTNO=' + localStorage.getItem('CLIENT_NO') + '&LICENSEPLATE=&CARGROUP=&CARSTATUS=1&CARTYPE='
      let { data } = await this.$Http.get(url)
      //时间排序
      this.originalData = data
      this.screenData()
    },
    async getAddress (row) {
      
      const _self = this;
      var point = new BMap.Point(row.LNG, row.LAT);
      var geoc = new BMap.Geocoder();
      geoc.getLocation(point, function (rs) {
        var addComp = rs.addressComponents;
        row.LOCATION = /*addComp.province + ", " + addComp.city + ", " + */addComp.district + "  " + addComp.street + "  " + addComp.streetNumber
      });
    },
    // 筛选数据
    screenData () {
      let { name, groupingValue, statusValue, carTypeValue } = this.form
      // if (statusValue === '在线') statusValue = '0'
      // if (statusValue === '离线') statusValue = '6'
      // if (name) this.screeningData = this.screeningData.filter(item => item.LICENSEPLATE.includes(name))
      // if (groupingValue) this.screeningData = this.screeningData.filter(item => item.CLIENTNO.includes(groupingValue))
      // if (carTypeValue !== '全部') this.screeningData = this.screeningData.filter(item => item.CARTYPE === carTypeValue)
      // if (statusValue !== '全部') this.screeningData = this.screeningData.filter(item => item.STATUS === statusValue)
      var listJISAO = [], listXXJISAO = [], listXICHEN = [], listXILU = [],
        listSASHUI = [], listGYQINGXI = [], listCHUXUE = [];
      var listJISAO_Offline = [], listXXJISAO_Offline = [], listXICHEN_Offline = [], listXILU_Offline = [],
        listSASHUI_Offline = [], listGYQINGXI_Offline = [], listCHUXUE_Offline = [];
      this.screeningData = []
      this.originalData.forEach(item => {
        if (item.LOCATION === '') {
          this.getAddress(item)
        }
        if (!item.LICENSEPLATE.includes(name)) {
          return;
        }
        if (!item.CLIENTNO.includes(groupingValue)) {
          return;
        }
        if (carTypeValue !== '全部' && item.CARTYPE != carTypeValue) {
          return;
        }
        if (statusValue !== '全部' && item.STATUS != statusValue) {
          return;
        }
        if (item.STATUS === 0) {
          item.STATUSstr = "在线"
          switch (item.CARTYPE) {
            case '机扫车':
              {
                listJISAO.push(item)
              }
              break;
            case '小型机扫车':
              {
                listXXJISAO.push(item)
              }
              break;
            case '吸尘车':
              {
                listXICHEN.push(item)
              }
              break;
            case '洗路车':
              {
                listXILU.push(item)
              }
              break;
            case '洒水车':
              {
                listSASHUI.push(item)
              }
              break;
            case '高压清洗车':
              {
                listGYQINGXI.push(item)
              }
              break;
            case '除雪车':
              {
                listCHUXUE.push(item)
              }
              break;
          }
        } else {
          item.STATUSstr = "离线"
          switch (item.CARTYPE) {
            case '机扫车':
              {
                listJISAO_Offline.push(item)
              }
              break;
            case '小型机扫车':
              {
                listXXJISAO_Offline.push(item)
              }
              break;
            case '吸尘车':
              {
                listXICHEN_Offline.push(item)
              }
              break;
            case '洗路车':
              {
                listXILU_Offline.push(item)
              }
              break;
            case '洒水车':
              {
                listSASHUI_Offline.push(item)
              }
              break;
            case '高压清洗车':
              {
                listGYQINGXI_Offline.push(item)
              }
              break;
            case '除雪车':
              {
                listCHUXUE_Offline.push(item)
              }
              break;
          }
        }
        if (item.VIDEO === 0 || item.VIDEO === "") {
          item.VIDEO = ""
        } else {
          item.VIDEO = "支持视频监控"
        }
        if (item.IsSetupOil === 0 || item.IsSetupOil === "") {
          item.IsSetupOil = ""
          item.OIL = ""
        } else {
          item.IsSetupOil = "支持油耗"
        }
        if (item.IsSetupWater === '0' || item.IsSetupWater === "") {
          item.IsSetupWater = ""
          item.WATER = ""
        } else {
          item.IsSetupWater = "支持水量"
        }
        if(item.LOCK === -1) {
          item.LOCK = "作业中(未)"
        }else if (item.LOCK === 0 || item.LOCK === "") {
          item.LOCK = ""
        } else {
          item.LOCK = "作业中"
        }
        if (item.LOCKSTATUS === 0 || item.LOCKSTATUS === "") {
          item.LOCKSTATUS = ""
        } else {
          item.LOCKSTATUS = "支持开关量"
        }
        item.GPSTIME = item.GPSTIME.split('.')[0].replace('T', ' ')
        this.screeningData.push(item)
      })
      this.screeningData = this.screeningData.filter(item => item.LOCK.includes(this.form.lockValue))
      this.carNum = this.screeningData.length
      eventBus.$emit('mapData_Vehicle', [listJISAO, listXXJISAO, listXICHEN, listXILU, listSASHUI, listGYQINGXI, listCHUXUE,
        listJISAO_Offline, listXXJISAO_Offline, listXICHEN_Offline, listXILU_Offline, listSASHUI_Offline, listGYQINGXI_Offline, listCHUXUE_Offline])
    },
    // 自动查询
    selectChange () {
      // let timeId = null
      if (this.switch_value) {
        var that = this
        this.timeID = setInterval(() => {
          that.getInfoList()
          
          if (!that.switch_value) clearInterval(that.timeID)
        }, 30000)
      }
    },
    // 实时在线统计
    async realtimeOnlineStatistics () {
      // var url = 'Vehicle/GetVehicleCurrentInfo?ClientNo=' + localStorage.getItem('CLIENT_NO')
      var url = 'Comprehensive/GetVehicleCurrentInfo?ClientNo=' + localStorage.getItem('CLIENT_NO') + '&typeName=' + '机扫&typeQuery=1'
      const { data } = await this.$Http.get(url)
      // this.statisticalData = data
      eventBus.$emit('realtimeOnlineStatistics_Vehicle', data)
    },
    // 关闭实时在线统计
    // close () {
    //   this.Visible = false
    //   eventBus.$emit('isCover', this.Visible)
    // },
    // 右键表格某一行
    rowHandle (row, column, event) {
      window.event.returnValue = false
      this.row = row
      this.MouseEvent.left = event.clientX
      this.MouseEvent.top = event.clientY - 26 * 4

      this.MouseEvent.isShow = true
      // this.teamNumber = row.CLIENT_NO
    },
    // // 显示班组区域
    // groupArea (CLIENT_NO) {
    //   eventBus.$emit('showGroupArea', CLIENT_NO)
    //   this.MouseEvent.isShow = false
    // },
    // // 显示清扫队区域
    // clearArea (CLIENT_NO) {
    //   eventBus.$emit('showClearArea', CLIENT_NO)
    //   this.MouseEvent.isShow = false
    // },
    // // 清除区域
    // cleanArea () {
    //   eventBus.$emit('clearArea')
    //   this.MouseEvent.isShow = false
    // },
    // 导出Excel
    exportExcel () {
      let excelName = ''
      if (!document.querySelector('.group li.selected span')) {
        excelName = '车辆实时信息列表'
      } else {
        excelName = document.querySelector('.group li.selected span').innerText + '-信息'
      }
      const tHeader = ['编号', '车辆名称', '车辆类型', '在线状态', '最终定位时间', '分组', '位置', '剩余油量', '安装油耗',
        '安装视频', '安装开关量', '方向', '速度', '经度', '纬度']
      const filterVal = ['VID', 'LICENSEPLATE', 'CARTYPE', 'STATUSstr', 'GPSTIME', 'CLIENTNAME', 'LOCATION', 'OIL', 'IsSetupOil',
        'VIDEO', 'LOCKSTATUS', 'DIRECTION', 'SPEED', 'LNG', 'LAT']
      export2Excel(tHeader, filterVal, this.screeningData, excelName)
    },
    // 点击表格某一行
    clickRow (row) {
      this.MouseEvent.isShow = false
      this.clickRowData = row
    },
    // 双击表格某一行
    dblClickRow (row) {
      eventBus.$emit('mapDBrowCar', row)
    },
    // 双击表格某一行
    dblClickRowMonitor (row) {
      eventBus.$emit('warningItem', row)
    },
    // 右键导出Excel
    exportRowExcel () {
      this.MouseEvent.isShow = false
      const excelName = this.row.CLIENT_NAME + '-' + this.row.LICENSEPLATE + '-信息'
      const tHeader = ['编号', '车辆名称', '分组', '称重时间', '吨数', '垃圾类型', '来源类型', '工作点位', '处理场名称', '车辆类型', '最终定位时间', '位置', '航向', '航速', '经度', '纬度']
      const filterVal = ['VID', 'LICENSEPLATE', 'CLIENT_NAME', 'WEIGHING_TIME', 'TONNANG', 'RUBBISHTYPE', 'POINTTYPE', 'WORKINGPOINT', 'FACTORY', 'CAR_TYPE', 'ORIENTATION_TIME', 'POSITION', 'Direction', 'SPEED', 'LONGITUDE', 'LATITUDE']
      let ary = []
      ary.push(this.row)
      export2Excel(tHeader, filterVal, ary, excelName)
    },
    // // 开始跟踪
    // startTracking () {
    //   if (!this.clickRowData) {
    //     this.$message({
    //       message: '请先选择一位人员！',
    //       type: 'warning'
    //     })
    //     return false
    //   }
    //   this.clickRowData.isShow = true
    //   this.disabled1 = true
    //   this.disabled2 = false
    //   eventBus.$emit('Tracking', this.clickRowData)
    //   let timeId = null
    //   timeId = setInterval(() => {
    //     this.screenData()
    //     eventBus.$emit('Tracking', this.clickRowData)
    //     // console.log(11)
    //     if (this.trackingValue) clearInterval(timeId)
    //   }, 6000)
    // },
    // // 取消跟踪
    // cancelTracking () {
    //   this.trackingValue = true
    //   this.disabled1 = false
    //   this.disabled2 = true
    // },
    // 鼠标进入单元格显示其内容
    cellMouseEnter (row, column, cell, event) {
      cell.setAttribute('title', cell.innerText)
    },
    // 轨迹回放
    trajectory () {
      this.MouseEvent.isShow = false
      // 进入轨迹回放页面
      this.$router.push({ path: '/vehiclePlayback', query: { VID: this.row.VID, CARTYPE: this.row.CARTYPE} })
    },
    showCCTV () {
      this.MouseEvent.isShow = false
      if (this.row.VIDEO === "") {
        this.$message.error('此车辆不支持视频');
      } else {
        eventBus.$emit('showCCTV_Vehicle', { carNo: this.row.LICENSEPLATE, simNo: this.row.CARDNO })
      }
    },
    showYHLine () {
      this.MouseEvent.isShow = false
      if (this.row.IsSetupOil === "支持油耗") {
          eventBus.$emit('HYEcharts_Vehicle', { CarID: this.row.VID, CarName: this.row.LICENSEPLATE})
        }else{
          this.$message.error('此车辆不支持油耗');
        }
    },
    showWaterLine () {
      this.MouseEvent.isShow = false
      if (this.row.IsSetupWater === "支持水量") {
          eventBus.$emit('HYEcharts_Vehicle', { CarID: this.row.VID, CarName: this.row.LICENSEPLATE})
        }else{
          this.$message.error('此车辆不支持水量');
        }
    },
    // // 获取处理厂
    async getPlaceWaterInfo () {
      var url = 'CarService/getPlaceWaterInfo?CLIENT_NO='+localStorage.getItem('CLIENT_NO')
      let { data } = await this.$Http.get(url)
      var arrayA = [], arrayP = [];
      data.forEach(element => {
        switch (element.TYPE) {
          case 'A':
            arrayA.push(element)
            break;
        case 'P':
            arrayP.push(element)
            break;
        }
      });
      // console.log('加水点')
      // console.log(data)
      eventBus.$emit('mapPlaceWater', arrayA)
      eventBus.$emit('mapPlacePollution', arrayP)
    },
    // // 获取中转站
    // async getPlacePointZZZApi () {
    //   var url = 'Vehicle/getPlaceZZZ?CLIENTNO='+localStorage.getItem('CLIENT_NO')
    //   let { data } = await this.$Http.get(url)
    //   eventBus.$emit('mapPlacePointZZZ', data)
    // },
    // // 获取农村点
    // async getPlacePointNCDApi () {
    //   var url = 'Vehicle/getPlaceNCD?CLIENTNO='+localStorage.getItem('CLIENT_NO')
    //   let { data } = await this.$Http.get(url)
    //   eventBus.$emit('mapPlacePointNCD', data)
    // },
    // // 获取餐饮单位
    // async getPlacePointCYApi () {
    //   var url = 'Vehicle/getPlaceNCD?CLIENTNO='+localStorage.getItem('CLIENT_NO')
    //   let { data } = await this.$Http.get(url)
    //   eventBus.$emit('mapPlacePointCY', data)
    // },
    // // 获取小区垃圾点
    // async getPlacePointXQCYApi () {
    //   var url = 'Vehicle/getPlaceNCD?CLIENTNO='+localStorage.getItem('CLIENT_NO')
    //   let { data } = await this.$Http.get(url)
    //   eventBus.$emit('mapPlacePointXQCY', data)
    // },
    // 获取处理厂边界点
    async getCLCPolygon () {
      var url = 'Vehicle/GetFactoryInfo?TYPE=1&ID=1001'
      let { data } = await this.$Http.get(url)
      eventBus.$emit('mapCLCPolygon', data)
    }
  },
  beforeDestroy () {
    clearInterval(this.timeID)
  }
}
</script>

<style scoped lang="less">
.monitoring {
  .el-form-item__content {
    max-width: 100px;
  }
  height: 100%;
  // position: relative;
  .el-form {
    width: 100%;
    height: 40px;
    line-height: 40px;
    // display: flex;
    // align-items: center;
    overflow: hidden;
    // border-bottom: 2px solid #007ACC;
    .el-form-item {
      // float: left;
      display: inline-block;
      margin: 0;
      // flex-shrink: 0;
      .el-input {
        height: 22px;
      }
    }
    .el-button {
      padding: 0 5px;
      height: 28px;
      border-radius: 2px;
      display: inline-block;
      /deep/span {
        font-size: 14px;
        // margin-left: 4px;
        line-height: 22px;
      }
    }
    .people_number {
      height: 40px;
      line-height: 40px;
      padding: 0 5px;
      color: #333;
      // float: left;
      display: inline-block;
      // flex-shrink: 0;
      span {
        display: inline-block;
        padding: 0 2px;
        height: 30px;
        border-bottom: 1px solid #ccc;
        box-sizing: border-box;
        text-align: center;
      }
    }
    .switch {
      display: inline-block;
      min-width: 100px;
      // height: 40px;
      // line-height: 40px;
      margin-left: 10px;
      // float: left;
      // flex-shrink: 0;
      span {
        margin-right: 2px;
        cursor: default;
        color: #606266;
      }
      .el-select {
        max-width: 100px;
        height: 22px;
        margin-left: 5px;
        /deep/.el-input__suffix {
          top: 8px;
          line-height: 24px;
        }
      }
    }
    .el-button {
      flex-shrink: 0;
    }
  }
  @media screen and (min-width: 1600px) {
    .fold_btn {
      opacity: 0;
    }
  }
  @media screen and (max-width: 1660px) {
    .el-form {
      width: 100%;
    }
    .fold_btn {
      display: inline-block;
    }
  }
  // @media screen and (min-width: 1455px) {

  // }
  @media screen and (max-width: 1455px) {
    .iconone {
      display: none !important;
    }
  }
  .fold_btn {
    position: relative;
  }
  .fold_btns {
    position: absolute;
    top: 65px;
    right: 0;
    width: auto;
    height: auto;
    overflow-y: scroll;
    background: #fff;
    z-index: 1111111;
    display: none;
  }
  .buttons {
    z-index: 55555;
    width: 80px;
    height: 120px;
    background: #eee;
  }
  .table_list {
    // position: absolute;
    // top: 70px;
    // bottom: 0px;
    margin-left: 20px;
    overflow-y: auto;
    width: calc(~'100% - 40px');

    height: calc(~'100% - 70px');
    .el-table {
      height: 100%;
    }
    /deep/.el-table__body-wrapper {
      height: calc(~'100% - 34px');
      overflow-y: auto;
    }
  }
}
// .icon-kaishi .icon-kaishi:hover{
//   background: #60a53e!important;
//   color: #eee;
// }
// .icon-tingzhi .icon-tingzhi:hover{
//   background: #cc8c8c!important;
//   color: #eee;
// }
.row_box {
  width: 120px;
  // height: 130px;
  color: #666;
  background-color: #f3f3f3;
  border: 1px solid #ccc;
  position: fixed;
  span {
    display: block;
    text-align: center;
    line-height: 26px;
    cursor: default;
    &:hover {
      color: #fff;
      background-color: #409eff;
    }
  }
}
// .row_box {
//   width: 120px;
//   // height: 130px;
//   color: #666;
//   background-color: #f3f3f3;
//   border: 1px solid #ccc;
//   position: fixed;
//   span {
//     display: block;
//     text-align: center;
//     line-height: 26px;
//     cursor: default;
//     &:hover {
//       color: #fff;
//       background-color: #007ACC;
//     }
//   }
// }
.statistical {
  width: 600px;
  min-height: 390px;
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 100;
  background-color: #fff;
  border-radius: 5px;
  overflow: hidden;
  .title {
    height: 40px;
    display: flex;
    align-items: center;
    border-bottom: 2px solid #ccc;
    padding-left: 5px;
    box-sizing: border-box;
    h3 {
      color: #666;
    }
    span {
      margin-left: 450px;
    }
  }
  .statistical_content {
    max-height: 350px;
    min-height: 310px;
    padding: 0 20px;
    background-color: #f3f3f3;
    overflow-y: auto;
  }
  .statistical_time {
    height: 40px;
    line-height: 40px;
    padding-left: 20px;
    color: #666;
    background-color: #f3f3f3;
    border-top: 1px solid #ccc;
    box-sizing: border-box;
  }
}
</style>
